<template>
      <el-tree
    ref="RefTree"
    :data="treeData"
    node-key="id"
    default-expand-all
    highlight-current
    check-on-click-node
    check-strictly
    :props="treeProps"
  />
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { getCurrentRolePermissionListApi } from '@/api/permission'
import userStore from '@/store/user'
let user = userStore()
const treeProps = {
  children: 'children',
  label: 'desc',
}
const treeData = ref([])
const current = ref(null)
current.value = user.$state.userInfo.value.roleid
let getgetTreePermission =async ()=>{
    try {
        let res = await getCurrentRolePermissionListApi({ roleid: current.value })
        treeData.value=res.data.data
    } catch (error) {
        console.log(error);
    }
}
onMounted(()=>{
    getgetTreePermission()
})
</script>